<ul class="breadcrumb">
    <li>
        <a href="/">首页</a> <span class="divider">/</span>
    </li>
    <li>
        <a href="#">系统管理</a> <span class="divider">/</span>
    </li>
    <li class="active">
        用户管理
    </li>
</ul>

<form class="form-search" method="get" action="/_system/admin">
    <select class="w150" name="city_id">
        <option value="0">全国</option>
        <?=Helper_HTML::getSelectMenu($cityList, $params['city_id'])?>
    </select>
    <select class="w150" name="role_id">
        <option value="0">全部角色</option>
        <?=Helper_HTML::getSelectMenu($roleList, $params['role_id'])?>
    </select>
    <input type="text" placeholder="搜索姓名" class="input-small" name="admin_name" value="<?=$params['admin_name']?>" />
    <input type="text" placeholder="搜索邮箱" class="input-medium" name="email" value="<?=$params['email']?>" />
    <button class="btn" type="submit">查询</button>
    <a href="/_system/admin/add" class="btn btn-primary pull-right">添加新用户</a>
</form>

<table class="table table-bordered" style="margin-bottom: 0;">
<thead>
    <tr>
        <th>姓名/用户名</th>
        <th>邮箱</th>
        <th>手机</th>
        <th>角色</th>
        <th>城市</th>
        <th>最后登录</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
</thead>
<tbody>
<? if ($list): ?>
<? foreach ($list as $value): ?>
    <tr>
        <td><?=$value['admin_name']?></td>
        <td><?=$value['email']?></td>
        <td><?=$value['mobile']?></td>
        <td><?=$roleList[$value['role_id']]?></td>
        <td><?=$cityList[$value['city_id']]?></td>
        <td><?=($value['last_login'] ? date('Y-m-d H:i', $value['last_login']) : '--')?></td>
        <td><?=Helper_CPanel::ajaxStatusLink('/_system/admin/change-status', $value['admin_id'], $value['status'])?></td>
        <td>
            <a href="/_system/admin/update/?admin_id=<?=$value['admin_id']?>">编辑</a>
            <a href="/_system/admin/delete/?admin_id=<?=$value['admin_id']?>" onclick="return confirm('确认删除这个用户吗?')">删除</a>
        </td>
    </tr>
<? endforeach; ?>
<? else: ?>
    <tr><td colspan="20">没有符合条件的记录</td></tr>
<? endif; ?>
</tbody>
</table>

<? if ($multipage): ?>
    <div class="pull-right"><?=$multipage?></div>
<? endif; ?>